﻿using System;
using CTEM.Controllers.Global;

/// <summary>
/// Entity for table Construction
/// </summary>

namespace CTEM.Models
{
    public class VH_ExpensesDTO
    {
        public long VehicleExpensesID { get; set; }
        public long VehicleID { get; set; }
        public long DebtID { get; set; }
        public DateTime DatePurchase { get; set; }
        public string Officer { get; set; }
        public string Contents { get; set; }
        public long MaterialID { get; set; }
        public long GroupMaterialID { get; set; }
        public double Quantity { get; set; }
        public long Price { get; set; }
        public long TotalCost { get; set; }
        public string Note { get; set; }
        public DateTime? CreatedDate { get; set; }
        public DateTime? LastUpdated { get; set; }
        public string CreatedBy { get; set; }
        public string UpdatedBy { get; set; }

        public string Unit { get; set; }
        public string PriceFormatted { get; set; }
        public string TotalCostFormatted { get; set; }

        public VH_ExpensesDTO()
        {
            VehicleExpensesID = 0;
            VehicleID = 0;
            DebtID = 0;
            DatePurchase = DateTime.Today;
            Officer = Constants.EMPTY_TEXT;
            TotalCost = 0;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof(VH_ExpensesDTO)) return false;
            return Equals((VH_ExpensesDTO)obj);
        }

        public bool Equals(VH_ExpensesDTO other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.VehicleExpensesID, VehicleExpensesID);
        }

        public static bool operator ==(VH_ExpensesDTO left, VH_ExpensesDTO right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(VH_ExpensesDTO left, VH_ExpensesDTO right)
        {
            return !Equals(left, right);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }  
}